def f1():
    print('first')
    try:
        nums[10]
        nums[10]
        nums[10]
        nums[10]
    except NameError:
        print('nums not exists')
    except IndexError:
        print('out of range')
    else:
        ...

    print('third')


def f2():
    f1()


def f3():
    try:
        f2()
    except IndexError:
        print('error occurred in f2(), captured by f3()')


f3()
print('f3() finished')
